package com.hmall.controller;

import com.hmall.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("task/")
@Api(value = "计划任务API", description = "计划任务-v2")
public class TaskController {

    private static final Logger logger = LoggerFactory.getLogger(TaskController.class);
    @Autowired
    private ContService contService;

    @Autowired
    private BiUserActionHistoryService biUserActionHistoryService;


    /**
     * 合同超时处理 计时任务
     * @return
     * @throws Exception
     */
    @GetMapping("taskOrderContEndOrderTime")
    @ApiOperation(value = "合同超时处理")
    public void taskOrderContEndOrderTime(String itemId )  {

        //查询合同如果超时就处理
        contService.updateTaskAgreeContTimeout(itemId);
    }

    /**
     * 每天计算PV插入 计时任务
     * @return
     * @throws Exception
     */
    @GetMapping("insertBiPvSchedule")
    @ApiOperation(value = "每天计算PV插入")
    public void insertBiPvSchedule( ) {

        biUserActionHistoryService.insertBiPvSchedule();
    }


}
